<!DOCTYPE html>
<html>

	<head>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/home/css/public.css" />
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/home/css/phone.css" />
	</head>
	<style type="text/css">
		
		body > div.page1mailcontent > form > div.one > input.ptShuru{
			width: 40%;
		}
		#btnSendCode{
			font-family: "微软雅黑";
			font-size: 1rem;
			width: 25%;
			height: 3rem;
			background: #FFFFFF;
			color: #232323;
			border: 2px solid #D1D1D1;
			border-radius: 10px;
		}
		body > div.page1mailcontent > form > div.one > label{
			padding-left: 1rem;
		}
	</style>

	<body>
		<p>
			确认信息
		</p>
		<!--================page1mailcontent=================-->
		<div class="page1mailcontent">
			<form action="__SELF__" method="post" name="my_f1">
				<!--手机号-->
				<div class="mail">
					<lable>识别号：</lable>
					<input class="phone" type="text" name="dksign" value=""/>
				</div>
				<div class="mail">
					<lable>真实姓名：</lable>
					<input class="phone" type="text" name="realname" value=""/>
				</div>

				<input type="submit" value="激&nbsp;&nbsp;活" />
			</form>
		</div>
		<!--page1mailcontent结束-->
	</body>
	<script src="__PUBLIC__/home/js/jquery-2.1.1.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="__PUBLIC__/home/js/font.js" type="text/javascript" charset="utf-8"></script>
	<script src="__PUBLIC__/home/js/forgetpassword.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
var InterValObj; //timer变量，控制时间
var count = 60; //间隔函数，1秒执行
var curCount;//当前剩余秒数
var code = ""; //验证码
var codeLength = 6;//验证码长度
function sendMessage() {
//	console.log("1")
curCount = count;
var dealType; //验证方式
var uid=$("#uid").val();//用户uid
if ($("#phone").attr("checked") == true) {
	dealType = "phone";
}
else {
	dealType = "email";
}
////判定手机号是否正确
//var reg = /^1[3|4|5|8][0-9]\d{8}$/
//if ($(".phone").val("")==" " || !reg.test($(".phone").val(""))) {
//	console.log("1")
//	$("#btnSendCode").on("click",function(){
//		alert("1")
//	})
//	
//} else{
//	$("#btnSendCode").on("click",function(){
//		sendMessage()
//	})
//}
//产生验证码
for (var i = 0; i < codeLength; i++) {
	code += parseInt(Math.random() * 9).toString();
}
//设置button效果，开始计时
	$("#btnSendCode").attr("disabled", "true");
	$("#btnSendCode").val( "重新发送(" + curCount +")" );
	InterValObj = window.setInterval(SetRemainTime, 1000); //启动计时器，1秒执行一次
//向后台发送处理数据
	$.ajax({
		type: "POST", //用POST方式传输
		dataType: "text", //数据格式:JSON
		url: '{:U("Public")}', //目标地址
		data: "dealType=" + dealType +"&uid=" + uid + "&code=" + code,
		error: function (XMLHttpRequest, textStatus, errorThrown) { },
		success: function (msg){ }
	});
}
//timer处理函数register
function SetRemainTime() {
	if (curCount == 0) {                
		window.clearInterval(InterValObj);//停止计时器
		$("#btnSendCode").removeAttr("disabled");//启用按钮
		$("#btnSendCode").val("重新发送");
		code = ""; //清除验证码。如果不清除，过时间后，输入收到的验证码依然有效    
	}
	else {
		curCount--;
		$("#btnSendCode").val(  "重新发送(" + curCount +")");
	}
}
</script>
</html>